<template>
  <Modal :class="content?'':'content-null'" :title="title" :visible="visible" :show-footer="false">
    <view class="component-content" v-if="content">
      {{ content }}
    </view>
    <view class="component-footer">
      <view class="component-footer-cancel" @click="onClose">{{ cancelText }}</view>
      <view class="component-footer-confirm" @click="onConfirm">{{ confirmText }}</view>
    </view>
  </Modal>
</template>

<script setup>
import {onLoad} from "@dcloudio/uni-app";

defineProps({
  title: {
    type: String,
    default: "标题"
  },
  content: {
    type: String,
    default: ""
  },
  cancelText: {
    type: String,
    default: "取消"
  },
  confirmText: {
    type: String,
    default: "确定"
  },
  visible: {
    type: Boolean,
    default: false
  }
})

const emits = defineEmits(['close', 'confirm'])

onLoad(() => {
})

const onClose = () => {
  emits('close')
}

const onConfirm = () => {
  emits('confirm')
}
</script>

<style lang="scss" scoped>
@import "noticeModal";
</style>
